home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / sys / syslog.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  7.9 KB  |  203 lines

  1. /*
  2.  * $Id: syslog.h,v 1.18 1994/03/17 04:21:50 jraja Exp $
  3.  *
  4.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  5.  *                    Helsinki University of Technology, Finland.
  6.  *                    All rights reserved.
  7.  *
  8.  * HISTORY
  9.  * $Log: syslog.h,v $
  10.  * Revision 1.18  1994/03/17  04:21:50  jraja
  11.  * Added INACTIVE switch to the log window parameters.
  12.  * (Suggested by Carsten Heyl.)
  13.  *
  14.  * Revision 1.17  1994/01/24  07:41:10  jraja
  15.  * Added prototypes for the openlog(), closelog() and setlogmask().
  16.  *
  17.  * Revision 1.16  1994/01/06  22:11:25  jraja
  18.  * Removed the unnecessary #ifndef AMITCP lines.
  19.  *
  20.  * Revision 1.15  1994/01/06  22:05:08  jraja
  21.  * Added inclusion of bsdsocket.h if necessary, cleaned the log.
  22.  *
  23.  * Revision 1.10  93/04/27  18:17:47  18:17:47  puhuri (Markus Peuhkuri)
  24.  * Changed default names of console and log.
  25.  * 
  26.  */
  27.  
  28. /*
  29.  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
  30.  * All rights reserved.
  31.  *
  32.  * Redistribution and use in source and binary forms, with or without
  33.  * modification, are permitted provided that the following conditions
  34.  * are met:
  35.  * 1. Redistributions of source code must retain the above copyright
  36.  *    notice, this list of conditions and the following disclaimer.
  37.  * 2. Redistributions in binary form must reproduce the above copyright
  38.  *    notice, this list of conditions and the following disclaimer in the
  39.  *    documentation and/or other materials provided with the distribution.
  40.  * 3. All advertising materials mentioning features or use of this software
  41.  *    must display the following acknowledgement:
  42.  *      This product includes software developed by the University of
  43.  *      California, Berkeley and its contributors.
  44.  * 4. Neither the name of the University nor the names of its contributors
  45.  *    may be used to endorse or promote products derived from this software
  46.  *    without specific prior written permission.
  47.  *
  48.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  49.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  50.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  51.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  52.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  53.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  54.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  55.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  56.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  57.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  58.  * SUCH DAMAGE.
  59.  *
  60.  *      @(#)syslog.h    7.20 (Berkeley) 2/23/91
  61.  */
  62.  
  63. #define _PATH_LOG       't:AmiTCP.log'
  64. #define _PATH_CON       'con:0/0/600/100/AmiTCPIP Log/AUTO/INACTIVE'
  65.  
  66.  
  67. /*
  68.  * priorities/facilities are encoded into a single 32-bit quantity, where the
  69.  * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
  70.  * (0-big number).  Both the priorities and the facilities map roughly
  71.  * one-to-one to strings in the syslogd(8) source code.  This mapping is
  72.  * included in this file.
  73.  *
  74.  * priorities (these are ordered)
  75.  */
  76. #define LOG_EMERG       0       /* system is unusable */
  77. #define LOG_ALERT       1       /* action must be taken immediately */
  78. #define LOG_CRIT        2       /* critical conditions */
  79. #define LOG_ERR         3       /* error conditions */
  80. #define LOG_WARNING     4       /* warning conditions */
  81. #define LOG_NOTICE      5       /* normal but significant condition */
  82. #define LOG_INFO        6       /* informational */
  83. #define LOG_DEBUG       7       /* debug-level messages */
  84.  
  85. #define LOG_PRIMASK     $07    /* mask to extract priority part (internal) */
  86.                                 /* extract priority */
  87. #define LOG_PRI(p)      ((p) & LOG_PRIMASK)
  88. #define LOG_MAKEPRI(fac, pri)   (((fac) << 3) | (pri))
  89.  
  90. #define INTERNAL_NOPRI  $10    /* the "no priority" priority */
  91.                                 /* mark "facility" */
  92. #define INTERNAL_MARK   LOG_MAKEPRI(LOG_NFACILITIES, 0)
  93.  
  94. OBJECT _code|CODE
  95.     c_name:PTR TO BYTE,
  96.     c_val:LONG,
  97.  
  98. /*
  99. CODE prioritynames[] = {
  100.         "alert",        LOG_ALERT,
  101.         "crit",         LOG_CRIT,
  102.         "debug",        LOG_DEBUG,
  103.         "emerg",        LOG_EMERG,
  104.         "err",          LOG_ERR,
  105.         "error",        LOG_ERR,                /* DEPRECATED */
  106.         "info",         LOG_INFO,
  107.         "none",         INTERNAL_NOPRI,         /* INTERNAL */
  108.         "notice",       LOG_NOTICE,
  109.         "panic",        LOG_EMERG,              /* DEPRECATED */
  110.         "warn",         LOG_WARNING,            /* DEPRECATED */
  111.         "warning",      LOG_WARNING,
  112.         NULL,           -1,
  113. };
  114. */
  115.  
  116. /* facility codes */
  117. #define LOG_KERN        (0<<3)  /* kernel messages */
  118. #define LOG_USER        (1<<3)  /* random user-level messages */
  119. #define LOG_MAIL        (2<<3)  /* mail system */
  120. #define LOG_DAEMON      (3<<3)  /* system daemons */
  121. #define LOG_AUTH        (4<<3)  /* security/authorization messages */
  122. #define LOG_SYSLOG      (5<<3)  /* messages generated internally by syslogd */
  123. #define LOG_LPR         (6<<3)  /* line printer subsystem */
  124. #define LOG_NEWS        (7<<3)  /* network news subsystem */
  125. #define LOG_UUCP        (8<<3)  /* UUCP subsystem */
  126. #define LOG_CRON        (9<<3)  /* clock daemon */
  127. #define LOG_AUTHPRIV    (10<<3) /* security/authorization messages (private) */
  128.  
  129.         /* other codes through 15 reserved for system use */
  130. #define LOG_LOCAL0      (16<<3) /* reserved for local use */
  131. #define LOG_LOCAL1      (17<<3) /* reserved for local use */
  132. #define LOG_LOCAL2      (18<<3) /* reserved for local use */
  133. #define LOG_LOCAL3      (19<<3) /* reserved for local use */
  134. #define LOG_LOCAL4      (20<<3) /* reserved for local use */
  135. #define LOG_LOCAL5      (21<<3) /* reserved for local use */
  136. #define LOG_LOCAL6      (22<<3) /* reserved for local use */
  137. #define LOG_LOCAL7      (23<<3) /* reserved for local use */
  138.  
  139. #define LOG_NFACILITIES 24      /* current number of facilities */
  140. #define LOG_FACMASK     $03f8  /* mask to extract facility part */
  141.                                 /* facility of pri */
  142. #define LOG_FAC(p)      (((p) & LOG_FACMASK) >> 3)
  143.  
  144.  
  145. /*
  146. CODE facilitynames[] = {
  147.         "auth",         LOG_AUTH,
  148.         "authpriv",     LOG_AUTHPRIV,
  149.         "cron",         LOG_CRON,
  150.         "daemon",       LOG_DAEMON,
  151.         "kern",         LOG_KERN,
  152.         "lpr",          LOG_LPR,
  153.         "mail",         LOG_MAIL,
  154.         "mark",         INTERNAL_MARK,          /* INTERNAL */
  155.         "news",         LOG_NEWS,
  156.         "security",     LOG_AUTH,               /* DEPRECATED */
  157.         "syslog",       LOG_SYSLOG,
  158.         "user",         LOG_USER,
  159.         "uucp",         LOG_UUCP,
  160.         "local0",       LOG_LOCAL0,
  161.         "local1",       LOG_LOCAL1,
  162.         "local2",       LOG_LOCAL2,
  163.         "local3",       LOG_LOCAL3,
  164.         "local4",       LOG_LOCAL4,
  165.         "local5",       LOG_LOCAL5,
  166.         "local6",       LOG_LOCAL6,
  167.         "local7",       LOG_LOCAL7,
  168.         NULL,           -1,
  169. };
  170. */
  171.  
  172. #define LOG_PRINTF      -1      /* pseudo-priority to indicate use of printf */
  173.  
  174. /*
  175.  * arguments to setlogmask.
  176.  */
  177. #define LOG_MASK(pri)   (1 << (pri))            /* mask for one priority */
  178. #define LOG_UPTO(pri)   ((1 << ((pri)+1)) - 1)  /* all priorities through pri */
  179.  
  180. /*
  181.  * Option flags for openlog.
  182.  *
  183.  * LOG_ODELAY no longer does anything.
  184.  * LOG_NDELAY is the inverse of what it used to be.
  185.  */
  186. #define LOG_PID         $01    /* log the pid with each message */
  187. #define LOG_CONS        $02    /* log on the console if errors in sending */
  188. #define LOG_ODELAY      $04    /* delay open until first syslog() (default) */
  189. #define LOG_NDELAY      $08    /* don't delay open */
  190. #define LOG_NOWAIT      $10    /* don't wait for console forks: DEPRECATED */
  191. #define LOG_PERROR      $20    /* log to stderr as well */
  192.  
  193. /*
  194. void openlog(const char *, int, int);
  195. void closelog(void);
  196. int setlogmask(int);
  197. */
  198. /*
  199.  * Include protos/inlines/pragmas for the syslog()
  200.  * (+ all other AmiTCP functions)
  201.  */
  202.  
  203.